package org.example.common.threadpool;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.*;

/**
 * @author : XieDong
 * @date : 2020/9/2 03:14
 */
public class ThreadFactoryUtil {

    public static final ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
            .setNameFormat("import-pool-%d").build();
    public static final ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1,
            0L, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<>(2), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());

}
